package org.otherworld.error;

public class Errer {

	public Errer() {
		
	}
	
	public static enum Errorcode {
		NOPARAMS, FILENOTFOUND, FOLDERNOTFOUND, NOFILES, NOFOLDERS, NOPARENT, NOCONNECTOR
	};
	
	public void displayError(Errorcode ec) {
		switch(ec) {
		case NOPARAMS:
			displayNoParametersError();
			break;
		case FILENOTFOUND:
			displayFileNotFoundError();
			break;
		case FOLDERNOTFOUND:
			displayFolderNotFoundError();
			break;
		case NOFILES:
			displayNoFiles();
			break;
		case NOFOLDERS:
			displayNoFolders();
			break;
		case NOPARENT:
			displayNoParent();
			break;
		case NOCONNECTOR:
			displayNoConnector();
			break;
		}
	}
	
	private void displayNoParametersError() {
		System.out.println("Not enough parameters were given for the command to run properly");
	}
	
	private void displayFileNotFoundError() {
		System.out.println("Can not find the file you are looking for");
	}
	
	private void displayFolderNotFoundError() {
		System.out.println("Can't find the folder you are looking for");
	}

	private void displayNoFiles() {
		System.out.println("  <no files>");
	}
	
	private void displayNoFolders() {
		System.out.println("  <no directories>");
	}
	
	private void displayNoParent() {
		System.out.println("Can't access parent directory, you are probably at the root.");
	}
	
	private void displayNoConnector() {
		System.out.println("Invalid connector, cannot run the command.");
	}
}
